def reverse(word, left, right):
    if left >= right:
        return
    word[left], word[right] = word[right], word[left]
    reverse(word, left + 1, right - 1)


word = ['h', 'e', 'l', 'l', 'o']
reverse(word, 0, len(word) - 1)
print(word)
